package com.dyfh.hello;

import java.util.ResourceBundle;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;

/**
 * 引导类
 * <p>
 * {@ComponentScan}的用途：
 * <li>自定扫描路径下边带有@Controller，@Service，@Repository，@Component注解加入spring容器</li>
 * <li>通过includeFilters加入扫描路径下没有以上注解的类加入spring容器</li>
 * <li>通过excludeFilters过滤出不用加入spring容器的类</li>
 * 
 * @author tanjx
 *
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@ComponentScan(basePackages = {"com.dyfh.hello", "com.dyfh.hello.*"})
public class HelloApplication {

    public static void main(String[] args) {
        System.out.println("start");
        SpringApplication app = new SpringApplication(HelloApplication.class);
        System.out.println("load");
        
        ResourceBundle bean = ResourceBundle.getBundle("code-generate-conf");
        String student = bean.getString("db.url");
        System.out.println(student);

        // app.addListeners(new UpmsEnvironmentListener());
        app.run(args);
    }

}
